<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/connopen.asp"-->
<!--#include file="lib/asp-common-lib.asp"-->
<!--#include file="lib/anupload/UpLoad_Class.asp"-->
<%
dim upload,iserr,desc
iserr = false
desc = ""
set upload = new AnUpLoad
upload.Exe = "jpg"
upload.MaxSize = 5 * 1024 * 1024 '5M
upload.GetData()
if upload.ErrorID>0 then 
	iserr = true
	desc = upload.Description
else
	dim file,savpath
    ' set fname = new UpLoadFileEx
	savepath = "upload"
	set file = upload.files("invoice_file")
	cd = upload.forms("invoice_cd")
	cdno = upload.forms("invoice_cdno")
	invoicetitle = upload.forms("invoice_title")
	invoicememo = upload.forms("invoice_memo")
    file.UserSetName=cdno&"-"&file.NewName
	if not(file is nothing) then
		result = file.saveToFile(savepath,-1,true)
		if result then
			desc = file.filename
            sql_invoice="insert into feeinvoice(cd,invoicefile,invoicetitle,invoicememo,uploaduser) values("&cd&",'"&savepath&"/"&desc&"','"&invoicetitle&"','"&invoicememo&"',"&session("iId")&")"
            ' sql_invoice="insert into feeinvoice(cd,invoicefile,invoicetitle,invoicememo) values(11622,'"&savepath&"/"&desc&"','"&invoicetitle&"','"&invoicememo&"')"
            invoiceid=ExecuteCommand(sql_invoice,true)
            if invoiceid then
                response.redirect("process.asp?id="&cd)
            end if
            
              ' set cmd_invoice=Server.CreateObject("ADODB.Command")
              ' cmd_invoice.ActiveConnection = conn
              ' cmd_invoice.CommandText = sql_invoice
              ' response.write(sql_invoice)
              ' response.end
              ' cmd_invoice.Execute
              ' set cmd_invoice=nothing

            
		else
			iserr = true
			desc = file.Exception
		end if
	else
		iserr = true
		desc = "没有上传文件"
	end if
end if
set upload = nothing
%>
<!--#include file="lib/connclose.asp"-->
